﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;
using System.Data;
using Microsoft.Practices.EnterpriseLibrary.Data;

namespace DbFramework.Data.Extension
{
    public static class ExtDatabase
    {
        public static DbCommand GetSqlStringCommand(this Database value, string query, CommandType commandType)
        {
            switch (commandType)
            {
                case CommandType.Text:
                case CommandType.TableDirect:
                    return value.GetSqlStringCommand(query);
                case CommandType.StoredProcedure:
                    return value.GetStoredProcCommand(query);
            }
            return null;
        }
    }
}
